package com.example.lab;

import static org.junit.Assert.*;

import org.junit.Test;

public class logic {
    //选择第一个if语句，即if (Side1 <= 0 || Side2 <= 0 || Side3 <= 0)
    //    Triang = 1 if triangle is scalene
    //    Triang = 2 if triangle is isosceles
    //    Triang = 3 if triangle is equilateral
    //    Triang = 4 if not a triangle
    trityp tri = new trityp();
    @Test
    public void triang() {
        //decision coverage
        assertEquals(4,tri.Triang(-1,1,1));
        assertEquals(3,tri.Triang(3,3,3));
        //condition coverage
        assertEquals(4,tri.Triang(2,3,7));

        //DC coverage
        assertEquals(4,tri.Triang(-1,1,1));
        assertEquals(4,tri.Triang(1,-1,1));
        assertEquals(4,tri.Triang(1,1,-1));
        assertEquals(4,tri.Triang(1,1,1));
        //BC coverage
        assertEquals(4,tri.Triang(-1,1,1));
        assertEquals(3,tri.Triang(3,3,3));
    }
}